
<!DOCTYPE html>
<html lang='en-US'>
    <head>
        <!--Document title is project name-->
        <title>NatCorder Scripting Reference on Calligraphy</title>
        <!--Extra information-->
        <meta name='description' content='NatCorder API documentation on Calligraphy'> <!--Populate from Calligraphy-->
        <meta name='keywords' content='NatCorder, Calligraphy, Unity'> <!--Populate from Calligraphy-->
        <meta name='author' content='Calligraphy by Yusuf Olokoba'>
        <meta charset='UTF-8'>
        <!--Style sheet-->
        <link rel='stylesheet' href='../Styles/memberstyles.css'>
    </head>
	
	<body>
        <h1 class='blockname'><a href='../Groups/MP4Recorder.html'>MP4Recorder</a>.CommitSamples</h1>
        <p1 class='faintname'>public  void CommitSamples (float[] sampleBuffer, long timestamp)<b>;</b></p1>
        <br>
        <br>
        <h2>Description</h2>
        <p1>Commit an audio sample buffer for encoding. <br><br>
            The sample buffer is expected to contain raw PCM sample data, interleaved by channel. 
            Each sample is expected to be a float in the range [-1.0, 1.0].</p1>
        <br>
        <br>
        
        <!--Code example-->
        <!--Must not be indented-->
        <!--There must be no space between the text and the pre tags-->

<code>
<pre><font color='green'>// Initialize this somewhere</font>
MP4Recorder videoRecorder;
IClock clock;

void OnAudioFilterRead (float[] data, int channels) { <font color='green'>// Invoked by Unity</font>
    <font color='green'>// Send to recorder for encoding</font>
    videoRecorder.CommitSamples(data, clock.Timestamp);
}</pre>
</code>
<br>
        
        
        <!--See Also-->
        
        
        <!--Copyright tag-->
        <br>
        <hr>
        <p1 class='copyright'><small>Copyright (c) Yusuf Olokoba 2016</small></p1>
        
	</body>
</html>        
        